<?php

namespace App\Http\Requests\Api;

class WxTokenRequest extends ApiRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'wx_code' => 'required',
            'type' => 'required',
            'encrypted_data' => 'required_if:type,js_personal,js_company,',
            'iv' => 'required_if:type,js_personal,js_company',
        ];
    }

    public function attributes()
    {
        return [
            'type' => '类型',
        ];
    }
}
